/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modelos;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author usuario
 */
public class ConexionDB{
    protected Connection conexion;
    
    public void conectar(){
        try {
            conexion = DriverManager.getConnection("jdbc:postgresql://localhost:5432/LabBurguer", "postgres", "123456");
            conexion.setAutoCommit(false);
        } catch (SQLException ex) {
            Logger.getLogger(ConexionDB.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void desconectar(){
        try {
            conexion.setAutoCommit(true);
            conexion.close();            
        } catch (SQLException ex) {
            Logger.getLogger(ConexionDB.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
